Regenerate wintesto.cmd
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 21 Sep 2004 02:14:02 +0000 (02:14 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 21 Sep 2004 02:14:02 +0000 (02:14 +0000)
gpsbabel/mingw/wintesto.cmd

index 938377b6c829b71926364acf7de4e2d5166e2eb0..f7f0e3586aeaa3bec37c179a4b998c8dbba0841f 100644 (file)
@@ -8,20 +8,34 @@ MKDIR %TMPDIR% 2>NUL:
 \r
 GOTO :REALSTART\r
 \r
-:COMPARE\r
-SET PARAM1=%1\r
-SET PARAM2=%2\r
-REM Test if param2 was a dir rather than a file, if so add a \* to make fc work\r
-FOR %%A IN (%2) DO IF "d--------"=="%%~aA" SET PARAM2=%2\*\r
+REM ==================================\r
+\r
+:CommonCOMPARE\r
+SET PARAM1=%2\r
+SET PARAM2=%3\r
+REM Test if param3 was a dir rather than a file, if so add a \* to make fc work\r
+FOR %%A IN (%3) DO IF "d--------"=="%%~aA" SET PARAM2=%3\*\r
 FOR /f "delims=" %%a IN ('fc %PARAM1% %PARAM2%') DO IF "x%%a"=="xFC: no differences encountered" GOTO :EOF\r
 REM Show the first 5 lines of difference\r
-fc /LB5 %PARAM1% %PARAM2%\r
+fc %1 /LB5 %PARAM1% %PARAM2%\r
 ECHO %* are not the same (first 5 differences above) - pausing. ^C to quit if required\r
 PAUSE\r
 GOTO :EOF\r
 \r
 REM ==================================\r
 \r
+:COMPARE\r
+CALL :CommonCOMPARE /L %1 %2\r
+GOTO :EOF\r
+\r
+REM ==================================\r
+\r
+:BINCOMPARE\r
+CALL :CommonCOMPARE /B %1 %2\r
+GOTO :EOF\r
+\r
+REM ==================================\r
+\r
 :SORTandCOMPARE\r
 SORT <%1 >%TMPDIR%\s1\r
 SORT <%2 >%TMPDIR%\s2\r
@@ -40,6 +54,7 @@ IF NOT EXIST %PNAME% ECHO Can't find %PNAME%&& GOTO :EOF
 \r
 \r
 \r
+\r
 REM Geocaching .loc\r
 DEL %TMPDIR%\gl.loc\r
 @echo on\r
@@ -121,9 +136,9 @@ REM CSV (Comma separated value) data.
 @echo.\r
 CALL :COMPARE %TMPDIR%\csv2.csv %TMPDIR%\csv.csv \r
 \r
-REM\r
+REM \r
 REM Delorme TopoUSA 4 is a CSV strain.  \r
-REM\r
+REM \r
 DEL %TMPDIR%\xmap-1.gpx %TMPDIR%\xmap-2.gpx %TMPDIR%\xmap\r
 @echo on\r
 @echo Testing...\r
@@ -258,6 +273,16 @@ DEL %TMPDIR%\magnav.pdb %TMPDIR%\magnav.gpu %TMPDIR%\magnavt.gpu
 CALL :COMPARE %TMPDIR%\magnavt.gpu %TMPDIR%\magnav.gpu\r
 CALL :COMPARE reference\gu.wpt %TMPDIR%\magnav.gpu\r
 \r
+DEL %TMPDIR%\magnav.pdb\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i geo -f geocaching.loc -o magnav -F %TMPDIR%\magnav.pdb\r
+@echo off\r
+@echo.\r
+CALL :BINCOMPARE %TMPDIR%\magnav.pdb reference\magnav.pdb\r
+\r
+\r
+\r
 REM GPSPilot Tracker for PalmOS\r
 REM This test is eerily similar to the NAV Companion test.  In fact, the \r
 REM converted reference file (magnavr.gpu) is identical.\r
@@ -359,9 +384,9 @@ REM GPX output.
 @echo.\r
 CALL :COMPARE %TMPDIR%\ms1.gpx %TMPDIR%\ms2.gpx\r
 \r
-REM\r
+REM \r
 REM MRCB mapsource track test\r
-REM\r
+REM \r
 DEL %TMPDIR%\mps-track.mps\r
 @echo on\r
 @echo Testing...\r
@@ -378,9 +403,9 @@ DEL %TMPDIR%\mps-track.mps
 @echo.\r
 CALL :COMPARE %TMPDIR%\mps-track.mps reference\mps-empty.mps\r
 \r
-REM\r
+REM \r
 REM MRCB mapsource route test\r
-REM\r
+REM \r
 DEL %TMPDIR%\mps-route.mps\r
 @echo on\r
 @echo Testing...\r
@@ -398,12 +423,12 @@ DEL %TMPDIR%\mps-route.mps
 @echo.\r
 CALL :COMPARE %TMPDIR%\mps-route.mps reference\mps-empty.mps\r
 \r
-REM\r
+REM \r
 REM Geocaching Database is a binary Palm format that, like the GPX variants\r
 REM has a zillion "equivalent" encodings of any given record set.  So we\r
 REM read the reference file, spin it to GPX and back to GCDB and then spin\r
 REM that one to GPX.\r
-REM\r
+REM \r
 \r
 @echo on\r
 @echo Testing...\r
@@ -413,10 +438,10 @@ REM
 @echo.\r
 CALL :COMPARE %TMPDIR%\gcdb1.gpx %TMPDIR%\gcdb1.gpx\r
 \r
-REM\r
+REM \r
 REM Duplicate filter - Since filters have no format of their own, we use csv\r
 REM as an intermediate format for testing the filter.\r
-REM\r
+REM \r
 DEL %TMPDIR%\filterdupe.csv1 %TMPDIR%\filterdupe.csv2\r
 @echo on\r
 @echo Testing...\r
@@ -426,10 +451,10 @@ DEL %TMPDIR%\filterdupe.csv1 %TMPDIR%\filterdupe.csv2
 @echo.\r
 CALL :SORTandCOMPARE %TMPDIR%\filterdupe.csv1 %TMPDIR%\filterdupe.csv2\r
 \r
-REM\r
+REM \r
 REM Position filter -  Since very small distances are essentialy a duplicate \r
 REM position filter, we can test very similarly to the duplicate filter.\r
-REM\r
+REM \r
 DEL %TMPDIR%\filterpos.csv1 %TMPDIR%\filterpos.csv2\r
 @echo on\r
 @echo Testing...\r
@@ -439,9 +464,9 @@ DEL %TMPDIR%\filterpos.csv1 %TMPDIR%\filterpos.csv2
 @echo.\r
 CALL :SORTandCOMPARE %TMPDIR%\filterpos.csv1 %TMPDIR%\filterpos.csv2\r
 \r
-REM\r
+REM \r
 REM Radius filter\r
-REM\r
+REM \r
 DEL %TMPDIR%\radius.csv\r
 @echo on\r
 @echo Testing...\r
@@ -449,9 +474,9 @@ DEL %TMPDIR%\radius.csv
 @echo off\r
 @echo.\r
 CALL :COMPARE %TMPDIR%\radius.csv reference\r
-REM\r
+REM \r
 REM magellan SD card waypoint / route format\r
-REM\r
+REM \r
 DEL %TMPDIR%\magellan.rte\r
 @echo on\r
 @echo Testing...\r
@@ -460,10 +485,10 @@ DEL %TMPDIR%\magellan.rte
 @echo.\r
 CALL :COMPARE %TMPDIR%\magellan.rte reference\route\magellan.rte\r
 \r
-REM\r
+REM \r
 REM GPX routes -- since GPX contains a date stamp, tests will always\r
 REM fail, so we use magellan as an interim format...\r
-REM\r
+REM \r
 DEL %TMPDIR%\gpxroute.gpx %TMPDIR%\maggpx.rte\r
 @echo on\r
 @echo Testing...\r
@@ -473,10 +498,10 @@ DEL %TMPDIR%\gpxroute.gpx %TMPDIR%\maggpx.rte
 @echo.\r
 CALL :COMPARE %TMPDIR%\maggpx.rte reference\route\magellan.rte\r
 \r
-REM\r
+REM \r
 REM GPX tracks -- since GPX contains a date stamp, tests will always\r
 REM fail, so we use magellan as an interim format...\r
-REM\r
+REM \r
 DEL %TMPDIR%\gpxtrack.gpx %TMPDIR%\maggpx.trk\r
 @echo on\r
 @echo Testing...\r
@@ -486,9 +511,9 @@ DEL %TMPDIR%\gpxtrack.gpx %TMPDIR%\maggpx.trk
 @echo.\r
 CALL :COMPARE %TMPDIR%\maggpx.trk %TMPDIR%\gpxtrack.gpx\r
 \r
-REM\r
+REM \r
 REM MAPSEND waypoint / route format\r
-REM\r
+REM \r
 DEL %TMPDIR%\route.mapsend\r
 @echo on\r
 @echo Testing...\r
@@ -496,9 +521,9 @@ DEL %TMPDIR%\route.mapsend
 @echo off\r
 @echo.\r
 CALL :COMPARE %TMPDIR%\route.mapsend reference\route\r
-REM\r
+REM \r
 REM MAPSEND track format \r
-REM\r
+REM \r
 DEL %TMPDIR%\mapsend.trk\r
 @echo on\r
 @echo Testing...\r
@@ -506,9 +531,9 @@ DEL %TMPDIR%\mapsend.trk
 @echo off\r
 @echo.\r
 CALL :COMPARE %TMPDIR%\mapsend.trk reference\track\r
-REM\r
+REM \r
 REM copilot\r
-REM\r
+REM \r
 DEL %TMPDIR%\copilot.pdb\r
 @echo on\r
 @echo Testing...\r
@@ -519,9 +544,9 @@ DEL %TMPDIR%\copilot.pdb
 @echo.\r
 CALL :COMPARE %TMPDIR%\cop1.gpx %TMPDIR%\cop2.gpx\r
 \r
-REM\r
+REM \r
 REM EasyGPS.   Another binary format.\r
-REM\r
+REM \r
 DEL %TMPDIR%\easy.loc\r
 @echo on\r
 @echo Testing...\r
@@ -532,11 +557,11 @@ DEL %TMPDIR%\easy.loc
 @echo.\r
 CALL :COMPARE %TMPDIR%\ez1.gpx %TMPDIR%\ez2.gpx\r
 \r
-REM\r
+REM \r
 REM GPilotS.   A Palm format.  Another binary format that \r
-REM\r
+REM \r
 REM rm -f ${TMPDIR/gpilots.l\r
-REM${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx\r
+REM ${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx\r
 @echo on\r
 @echo Testing...\r
 %PNAME% -i geo -f geocaching.loc -o gpilots -F %TMPDIR%\blah.pdb\r
@@ -545,9 +570,9 @@ REM${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx
 @echo off\r
 @echo.\r
 CALL :COMPARE %TMPDIR%\1.gpx %TMPDIR%\2.gpx\r
-REM${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx\r
+REM ${PNAME} -i easygps -f reference/gpilots.pdb -o gpx -F ${TMPDIR}/gp.gpx\r
 \r
-REM\r
+REM \r
 REM Navicache.\r
 @echo on\r
 @echo Testing...\r
@@ -555,7 +580,7 @@ REM Navicache.
 @echo off\r
 @echo.\r
 CALL :COMPARE %TMPDIR%\navi.wpt reference\navicache.ref\r
-REM\r
+REM \r
 \r
 REM PsiTrex.  A text format that can't be handled by XCSV due to context of\r
 REM data based on other data values in the file\r
@@ -619,9 +644,9 @@ DEL %TMPDIR%\psit-tw.mps
 @echo.\r
 CALL :COMPARE reference\mps-empty.mps %TMPDIR%\psit-tw.mps\r
 \r
-REM\r
+REM \r
 REM Arc Distance filter\r
-REM\r
+REM \r
 DEL %TMPDIR%\arcdist.txt\r
 @echo on\r
 @echo Testing...\r
@@ -630,9 +655,9 @@ DEL %TMPDIR%\arcdist.txt
 @echo.\r
 CALL :COMPARE %TMPDIR%\arcdist.txt reference\arcdist_output.txt\r
 \r
-REM\r
+REM \r
 REM Polygon filter\r
-REM\r
+REM \r
 DEL %TMPDIR%\polygon.txt\r
 @echo on\r
 @echo Testing...\r
@@ -641,9 +666,9 @@ DEL %TMPDIR%\polygon.txt
 @echo.\r
 CALL :COMPARE %TMPDIR%\polygon.txt reference\polygon_output.txt\r
 \r
-REM\r
+REM \r
 REM Simplify filter\r
-REM\r
+REM \r
 DEL %TMPDIR%\simplify.txt\r
 @echo on\r
 @echo Testing...\r
@@ -652,10 +677,10 @@ DEL %TMPDIR%\simplify.txt
 @echo.\r
 CALL :COMPARE %TMPDIR%\simplify.txt reference\simplify_output.txt\r
 \r
-REM\r
+REM \r
 REM Route reversal filter.   Do it twice and be sure we get what we\r
 REM started with.\r
-REM\r
+REM \r
 DEL %TMPDIR%\reverse1.arc %TMPDIR%\reverse2.arc %TMPDIR%\reference.arc\r
 @echo on\r
 @echo Testing...\r
@@ -667,11 +692,19 @@ DEL %TMPDIR%\reverse1.arc %TMPDIR%\reverse2.arc %TMPDIR%\reference.arc
 REM Verify the first and last are the same\r
 CALL :COMPARE %TMPDIR%\reference.arc  %TMPDIR%\reverse2.arc\r
 REM Verify the first and second are different.\r
+REM ${DIFF}  ${TMPDIR}/reverse1.arc  ${TMPDIR}/reverse2.arc > /dev/null && {\r
+REM            echo ERROR Failed reversal test.\r
+REM            exit 1\r
+REM }\r
 \r
-REM\r
+REM parkrrrr: This isn't a straightforward compare; we *want* it to fail.\r
+REM Obviously this test should just be rewritten with a new reference.\r
+REM compare  ${TMPDIR}/reverse1.arc  ${TMPDIR}/reverse2.arc\r
+\r
+REM \r
 REM Geoniche: No reference file was available, so we created one and just\r
 REM test it against itself.\r
-REM\r
+REM \r
 DEL %TMPDIR%\gn.pdb %TMPDIR%\1.gpx %TMPDIR%\2.gpx\r
 @echo on\r
 @echo Testing...\r
@@ -680,21 +713,23 @@ DEL %TMPDIR%\gn.pdb %TMPDIR%\1.gpx %TMPDIR%\2.gpx
 %PNAME% -i geoniche -f %TMPDIR%\gn.pdb -o gpx -F %TMPDIR%\2.gpx\r
 @echo off\r
 @echo.\r
+CALL :COMPARE %TMPDIR%\1.gpx %TMPDIR%\2.gpx\r
 \r
-REM\r
+REM \r
 REM saroute covers *.anr, *.rte, and *.rtd, but I only have an .anr for testing.\r
 REM Unfortunately for us, this is a read-only format for now.\r
-REM\r
+REM \r
 @echo on\r
 @echo Testing...\r
 %PNAME% -t -i saroute -f reference\track\i65.anr -o gpx -F %TMPDIR%\gpl1.gpx\r
 %PNAME% -t -i gpx -f reference\track\i65.anr.gpx -o gpx -F %TMPDIR%\gpl2.gpx\r
 @echo off\r
 @echo.\r
+CALL :COMPARE %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx\r
 \r
-REM\r
+REM \r
 REM Delorme GPL file.   This is sort of a track format.\r
-REM\r
+REM \r
 DEL %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx %TMPDIR%\gpl1.gpl\r
 @echo on\r
 @echo Testing...\r
@@ -703,15 +738,145 @@ DEL %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx %TMPDIR%\gpl1.gpl
 %PNAME% -t -i gpl -f %TMPDIR%\gpl1.gpl -o gpx -F %TMPDIR%\gpl2.gpx\r
 @echo off\r
 @echo.\r
+CALL :COMPARE %TMPDIR%\gpl1.gpx %TMPDIR%\gpl2.gpx\r
 \r
-REM\r
+REM \r
 REM NetStumbler Summary File (read-only)\r
-REM\r
+REM \r
 DEL %TMPDIR%\netstumbler.mps\r
 @echo on\r
 @echo Testing...\r
 %PNAME% -i netstumbler -f reference\netstumbler.txt -o mapsource -F %TMPDIR%\netstumbler.mps\r
 @echo off\r
 @echo.\r
-CALL :COMPARE %TMPDIR%\netstumbler.mps reference\netstumbler.mps\r
+CALL :BINCOMPARE %TMPDIR%\netstumbler.mps reference\netstumbler.mps\r
+\r
+REM \r
+REM IGC tests\r
+REM \r
+DEL %TMPDIR%\igc*out\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i gpx -f reference\igc1.gpx -o igc -F %TMPDIR%\igc.out\r
+@echo off\r
+@echo.\r
+FINDSTR /V "XXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out\r
+CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc1_igc.out\r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i igc -f %TMPDIR%\igc.out -o gpx -F %TMPDIR%\igc.gpx\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\igc.gpx reference\igc1_gpx.out\r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i gpx -f %TMPDIR%\igc.gpx -o igc -F %TMPDIR%\igc.out\r
+@echo off\r
+@echo.\r
+FINDSTR /V "XXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out\r
+CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc1_igc.out\r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i gpx -f reference\igc1_baro.gpx -i igc -f reference\igc1_igc.out -o igc,timeadj=auto -F %TMPDIR%\igc.out\r
+@echo off\r
+@echo.\r
+FINDSTR /V "XXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out\r
+CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc1_3d.out\r
+\r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i igc -f reference\igc2.igc -o gpx -F %TMPDIR%\igc.gpx\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\igc.gpx reference\igc2_gpx.out\r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i gpx -f %TMPDIR%\igc.gpx -o igc -F %TMPDIR%\igc.out\r
+@echo off\r
+@echo.\r
+FINDSTR /V "XXXGenerated by GPSBabel Version" %TMPDIR%\igc.out> %TMPDIR%\igc_sed.out\r
+CALL :COMPARE %TMPDIR%\igc_sed.out reference\igc2_igc.out\r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i igc -f %TMPDIR%\igc.out -o gpx -F %TMPDIR%\igc.gpx\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\igc.gpx reference\igc2_gpx.out\r
+\r
+\r
+REM \r
+REM XCSV "human readable" tests\r
+REM \r
+DEL %TMPDIR%\humanread.out\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i xcsv,style=reference\humanread.style -f reference\human.in -o arc -F %TMPDIR%\humanread.out\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\humanread.out reference\humanread.out\r
+\r
+DEL %TMPDIR%\humanwrite.out\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i xcsv,style=reference\humanread.style -f reference\human.in -o xcsv,style=reference\humanwrite.style -F %TMPDIR%\humanwrite.out\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\humanwrite.out reference\humanwrite.out\r
+\r
+REM \r
+REM XCSV "path distance" test\r
+REM \r
+DEL %TMPDIR%\pathdist.out\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i magellan -f reference\dusky.trk -o xcsv,style=reference\gnuplot.style -F %TMPDIR%\pathdist.out\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\pathdist.out reference\dusky.gnuplot\r
+\r
+REM hsandv\r
+DEL %TMPDIR%\hsandv.exp %TMPDIR%\1.exp %TMPDIR%\1.exp %TMPDIR%\Glad_5.exp\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i geo -f geocaching.loc -o hsandv -F %TMPDIR%\hsandv.exp\r
+@echo off\r
+@echo.\r
+CALL :COMPARE %TMPDIR%\hsandv.exp reference\r
+REM the hsandv format is too lossy to do this test :(\r
+REM ${PNAME} -i hsandv -f ${TMPDIR}/hsandv.exp -o geo -F ${TMPDIR}/1.exp\r
+REM ${PNAME} -i hsandv -f reference/hsandv.exp -o geo -F ${TMPDIR}/2.exp\r
+REM compare ${TMPDIR}/1.exp ${TMPDIR}/2.exp\r
+REM test conversion from v4 to v5 files\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i hsandv -f reference\Glad_4.exp -o hsandv -F %TMPDIR%\Glad_5.exp\r
+@echo off\r
+@echo.\r
+REM Can't compare directly because of potential FP rounding.\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i hsandv -f %TMPDIR%\Glad_5.exp -o gpx -F %TMPDIR%\g5.gpx\r
+%PNAME% -i hsandv -f reference\Glad_5.exp -o gpx -F %TMPDIR%\g5r.gpx\r
+@echo off\r
+@echo.\r
+REM exit 1\r
+REM compare  ${TMPDIR}/g5.gpx ${TMPDIR}/g5r.gpx\r
+\r
+REM \r
+REM stack filter tests\r
+REM These don't actually test for proper behavior, for now, but they do \r
+REM exercise all of the currently-extant filter code.\r
+REM \r
+\r
+@echo on\r
+@echo Testing...\r
+%PNAME% -i geo -f geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o\r
+@echo off\r
+@echo.\r
 \r